<template>
  <div class="statistical-view">
    <!-- 统计面板 -->
    <div class="statistical-view-header">
      <div class="statistical-view-header-item" v-for="value in 8" :key="value">
        <img src="../../icons/svg/star1.svg" />
        <div>
          <p>船舶数量</p>
          <p>100</p>
        </div>
      </div>
    </div>
    <!-- 统计图表 -->
    <div class="statistical-view-chart">
      <!-- 右侧地图 -->
      <div class="statistical-view-chart-map">
        <statisticalMap />
      </div>
      <div class="statistical-view-chart-right">
        <!-- 左侧折线图 -->
        <div class="statistical-view-chart-right-line">
          <statisticalLine />
        </div>
        <!-- 左侧柱状图 -->
        <div class="statistical-view-chart-right-bar">
          <statisticalBar />
        </div>
      </div>
    </div>
    <!-- 底部统计表格 -->
    <div class="statistical-view-table">
      <div>
        <p>安全问题跟踪</p>
        <p class="subtext">未处理安全问题列表</p>
        <el-table :data="tableData">
          <el-table-column
            v-for="column in columns1"
            :key="column.prop"
            :prop="column.prop"
            :label="column.label"
           align="center"
          >
          </el-table-column>
        </el-table>
      </div>
      <div>
        <p>安全问题跟踪</p>
        <p class="subtext">未处理安全问题列表</p>
        <el-table :data="tableData">
          <el-table-column
            v-for="column in columns1"
            :key="column.prop"
            :prop="column.prop"
            :label="column.label"
             align="center"
          >
          </el-table-column>
        </el-table>
      </div>
      <div>
        <p>安全问题跟踪</p>
        <p class="subtext">未处理安全问题列表</p>
        <el-table :data="tableData">
          <el-table-column
            v-for="column in columns1"
            :key="column.prop"
            :prop="column.prop"
            :label="column.label"
            align="center"
          >
          </el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from "vue";
import statisticalMap from "./component/statisticalMap.vue";
import statisticalLine from "./component/statisticalLine.vue";
import statisticalBar from "./component/statisticalBar.vue";
const columns1 = ref([
  {
    prop: "date",
    label: "日期",
  },
  {
    prop: "shipName",
    label: "船舶名称",
  },
  {
    prop: "voyageNo",
    label: "航次号",
  },
  {
    prop: "position",
    label: "位置",
  }
]);
const tableData = ref([
  {
    date: "2020-01-01",
    shipName: "船舶1",
    voyageNo: "VOY001",
    position: "中国"
  },
  {
    date: "2020-01-02",
    shipName: "船舶2",
    voyageNo: "VOY002",
    position: "美国"
  },
  {
    date: "2020-01-02",
    shipName: "船舶2",
    voyageNo: "VOY002",
    position: "美国"
  },
  {
    date: "2020-01-02",
    shipName: "船舶2",
    voyageNo: "VOY002",
    position: "美国"
  }
]);

onMounted(() => {});
</script>
<style lang="scss" scoped>
.statistical-view {
  padding: 10px;
  &-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: #fff;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
    &-item {
      display: flex;
      align-items: center;
      img {
        width: 36px;
        height: 36px;
      }
      p {
        line-height: 24px;
        font-size: 14px;
        color: #000;
        margin: 0 0 0 10px;
      }
    }
  }
  &-chart {
    width: 100%;
    height: 400px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;
    &-map {
      width: 40%;
      height: 100%;
    }
    &-right {
      width: 59.5%;
      margin-left: 10px;
      &-line {
        width: 100%;
        height: 49.5%;
        margin-bottom: 1%;
      }
      &-bar {
        width: 100%;
        height: 49.5%;
      }
    }
  }
  &-table{
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    width: 100%;
    gap: 10px;
    >div{
      padding: 10px;
      width: 33%;
      box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
      >p{
        margin:0;
        font-size: 16px;
        color: #000;
      }
      .subtext{
        margin: 8px 10px;
        font-size: 12px;
        color: #666;
      }
    }
  }
}
</style>
